how to add to an exsiting value of an index in a list

36

foo = [1, 2, 3, 4, 5]
foo[3] = foo[3] + 4     
print(foo)            # [1, 2, 3, 8, 5]

Comments

Submit
0 Comments